#include "SemanticHandler/RDFSProcessor/structure/Term.h"  // 基本的元素
//#include "SemanticHandler/RDFSProcessor/structure/Predicate.h" //三元体查询
#include "SemanticUtil/Binding.h" //答案的单个绑定
#include "SemanticUtil/NTuple.h"  //多个绑定组成的答案


#ifndef _STATEMENT_H_
#define _STATEMENT_H_
class Statement{
public:
	Statement();
	~Statement();
	Statement( Term subj, Term pred, Term obj,  Term cont );
	Statement(const Statement& other );
    Statement& operator=(const Statement& other );
    //@}

    //@{
    bool operator==( const Statement& other ) const;
    bool operator!=( const Statement& other ) const;

    /**
     * Match this statement against template statement \a other. The only difference
     * to operator== is that empty nodes are matched as wildcards,
     * i.e. they match any other node.
     *
     * Be aware that the following is NOT always true since only \a other
     * is treated a a wildcard:
     *
     * \code
     * // NOT always true:
     * a.matches(b) == b.matches(a)
     * \endcode
     *
     * \return \p true if this statement matches other, \p false if not.
     *
     * \sa Node::matches()
     */
    bool matches( const Statement& other ) const;
    //@}

    //@{
    /**
     * A Statement is valid if the subject is a resource or blank
     * node, the predicate is a resource node,
     * and the object is a valid node.
     *
     * \return @p true if the Statement is valid, @p false otherwise
     */
    bool isValid() const;
    //@}

    //@{
    /**
     * \return The subject.
     */
    Term getSubject();

    /**
     * \return The predicate.
     */
    Term getPredicate();

    /**
     * \return The object.
     */
    Term getObject();

    /**
     * \return The Context node.
     */
    Term getContext() const;
    //@}

    //@{
    /**
     * Change the Statement subject.
     *
     * \param subject The new subject.
     */
    void setSubject( const Term subject );
    void setSubject( std::string subj);

    /**
     * Change the Statement predicate.
     *
     * \param predicate The new predicate.
     */
    void setPredicate( const Term predicate );
    void setPredicate( std::string pred);
    /**
     * Change the Statement object.
     *
     * \param object The new object.
     */
    void setObject( const Term object );
    void setObject( std::string obj);

    /**
     * Change the Statement context.
     *
     * \param context The new Context.
     */
    void setContext( const Term context );
    void setContext (std::string context);
    //@}

    std::string toString();

public:
    Term subject;
    Term predicate;
    Term object;
    Term context;
};
#endif
